<template>
  <div class="main">
    <hips-spin />
    <div>this is main page</div>
  </div>
</template>

<script>
import { Spin } from '@hips/vue-ui';

import Dsx from '@hips/plugin-dataset-vuex';

export default {
  name: 'MainPage',
  components: {
    [Spin.name]: Spin,
  },
  data() {
    return {
      dsx: new Dsx({
        name: 'main',
      }),
    };
  },
  beforeRouteEnter(to, form, next) {
    next((vm) => {
      let searchObj = vm.dsx.getState('locationSearch') || {};
      console.log('searchObj = ', searchObj);
      vm.$dsxRouter.replace('page1');
    });
  },
};
</script>

<style scoped lang="less">
.main {
  display: flex;
  justify-content: center;
  padding-top: 50px;
}
</style>
